package com.baoyouqun.service;

import com.alibaba.cola.dto.Response;
import com.alibaba.cola.dto.SingleResponse;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baoyouqun.domain.CreateCmd.DemandInteractCreateCmd;
import com.baoyouqun.domain.Query.DemandInteractQuery;
import com.baoyouqun.domain.UpdateCmd.DemandInteractUpdateCmd;
import com.baoyouqun.domain.VO.DemandInteractVO;
import com.baoyouqun.entity.DemandInteract;

import java.util.List;
import java.util.Map;

public interface DemandInteractService extends IService

        <DemandInteract> {

    /**
     * 新增并返回实体
     */
    SingleResponse<DemandInteractVO> create(DemandInteractCreateCmd cmd);

    Response update(DemandInteractUpdateCmd cmd);

    /**
     * 根据ID查询VO
     */
    DemandInteractVO selectById(String id);

    /**
     * 分页查询VO
     */
    IPage<DemandInteractVO> pageVo(DemandInteractQuery query);

    Response operate(DemandInteractCreateCmd cmd);

    Response cancel(String demandId, String userId);

    List<Map<String, Object>> queryUserActions(String currentUserId, List<String> demandIds);

    Map<String, Integer> countValidByUserIds(List<String> userIds);
}